/**
 * 
 */
package cn.ipenta.jkb.utils;

import java.util.Random;

/**
 * @ClassName: RandomUtils
 * @Description: TODO
 * @author ipenta
 * @date 2017年4月14日 下午9:56:26
 * 
 */
public class RandomUtils {

	private static Random random = new Random();

	private static String[] regulatorids = "fda838d117d244ebab9bbebf6d27080e,a5ebeb3dff9b4fa8ad57d1c001ffe517,05e2d946c2dd48e59853783e1ddcfc2b,4d99bcaa7ddf409f93b0119b7575ca32,0fd50a6903d443539d05d9ebe3ca359e,bbead558a7c94c8e8814776dfa04bea6,e5c28425f26e4ddebe880c189187ac76"
			.split(",");

	public static int getSvNum() {
		return random.nextInt(5);

	}

	/**
	 * @return
	 */
	public static String getRegulatorid() {
		// TODO Auto-generated method stub
		return regulatorids[random.nextInt(7)];
	}


	public static String getRandomString(int length) { //length表示生成字符串的长度
		String base = "abcdefghijklmnopqrstuvwxyz0123456789";
		Random random = new Random();
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i++) {
			int number = random.nextInt(base.length());
			sb.append(base.charAt(number));
		}
		return sb.toString();
	}

}
